Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mention ready in the docs for connect #287

Merged
merged 2 commits into from
Oct 6, 2023
Merged

Conversation

natebosch
Copy link
Member

@natebosch natebosch commented Oct 6, 2023

Closes #280

Errors during connection can cause confusion because they escape a try
block unless there is an await channel.ready. Mention that ready can
complete as an error in the case of connection failure.

Closes #280

There can be confusion when there are errors creating the channel
because the only wait to catch them is to include an `await
channel.ready` in the try block. Mention that `ready` can complete as an
error in the case of connection failure.
@natebosch natebosch requested a review from brianquinlan October 6, 2023 18:46
CHANGELOG.md Outdated

- Update the examples to use `WebSocketChannel.ready` and clarify that
`WebSocketChannel.ready` should be awaited before sending data over the
`WebSocketChannel`.
- Mention `ready` in the docs for `conenct`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

connect

/// not established synchronously.
/// The [ready] future will complete after the channel is connected.
/// If there are errors creating the connection the [ready] future will
/// complete as an error.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't we normally say "with" an error? I'm not sure, feel free to ignore.

@natebosch natebosch merged commit f3ac1bf into master Oct 6, 2023
@natebosch natebosch deleted the connect-ready-error branch October 6, 2023 20:11
mosuem pushed a commit to dart-lang/http that referenced this pull request Dec 11, 2024
…el#287)

Closes dart-lang/web_socket_channel#280

There can be confusion when there are errors creating the channel
because the only wait to catch them is to include an `await
channel.ready` in the try block. Mention that `ready` can complete as an
error in the case of connection failure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some Exceptions cannot be Handled
2 participants